package com.th.controller;

import com.th.common.domain.UsUserAuthApply;
import com.th.config.web.BaseController;
import com.th.service.UsUserAuthApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author tuhang
 * @PackageName nswcy-crowdsource-client-server
 * @Package com.th.controller
 * @Date 2023/6/8 20:56
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/user/auth")
@Api(tags = "用户认证接口")
public class UsUserAuthApplyController extends BaseController {

    @Resource
    private UsUserAuthApplyService usUserAuthApplyService;

    /**
     * 用户提交认证请求
     * @param authType 认证类型
     * @param data 认证内容
     * @return
     */
    @PostMapping("/submit/{authType}")
    @ApiOperation("用户提交认证请求")
    public Boolean submitAuth(@PathVariable("authType") Integer authType,@RequestBody String data){
        return  usUserAuthApplyService.submitAuth(authType,data);
    }

    @GetMapping("/getAuthInfo/{authType}")
    @ApiOperation("查询当前最近一次提交的认证信息")
    public UsUserAuthApply getAuthInfo(@PathVariable("authType") Integer authType){
        return  usUserAuthApplyService.getAuthInfo(authType);
    }

}
